const routes = []
const files = require.context('.', false, /\.js$/)

files.keys().forEach(key => {
  if (['./index.js', './city.js', './cadmin.js', './province.js'].includes(key)) return
  routes.push(files(key).default)
})

routes.push({
  path: '*',
  redirect: '/error',
  hidden: true,
})

export default routes
